package com.itetchologyandenglish.home.controller.Page;

import com.itetchologyandenglish.home.enetity.News;
import com.itetchologyandenglish.home.enetity.Result;
import com.itetchologyandenglish.home.service.CompanyTypeService;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

@Controller
public class CompanyPageController {
    @Resource
    CompanyTypeService companyTypeService;
   @RequestMapping("/page/company")
    public ModelAndView company(){
       return new ModelAndView("ordinary");
   }
   @RequestMapping("/company/updateOrdinary")
    public ModelAndView updateOrdinary (Integer companyId,ModelAndView model){
       model.getModel().put("companyId",companyId);
       model.setViewName("updateOrdinary");
       return model;
   }
   @RequestMapping("/page/vip")
    public ModelAndView vip(){return new ModelAndView("vip");}
    @RequestMapping("/company/newVip")
    public ModelAndView newVip(@RequestParam(value="companyId",required = false) Integer companyId,ModelAndView model){
        System.out.println(companyId);
       model.getModel().put("companyId",companyId);
        System.out.println(companyTypeService.getCompanyType());
       model.getModel().put("companyTypeIdList",companyTypeService.getCompanyType());
       model.setViewName("newvip");
       return model;
    }
    @RequestMapping("/company/vipInformation")
    public ModelAndView vipInformation (Integer companyId,ModelAndView model){
        model.getModel().put("companyId",companyId);
        System.out.println(companyId);
        model.setViewName("vipInformation");
        return model;
    }
    @RequestMapping("/company/generalInformation")
    public ModelAndView generalInformation (Integer companyId,ModelAndView model){
        model.getModel().put("companyId",companyId);
        System.out.println(companyId);
        model.setViewName("generalInformation");
        return model;
    }

}
